package businss;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import service.vo.MessageVO;
import struts.action.Action;
import struts.form.ActionForm;

@struts.annotation.Action("/panduan")
public class PanduanAction implements Action {

	@Override
	public String execute(HttpServletRequest request,ActionForm form,Map<String, String> forwardMap) {
		String name = request.getParameter("name");
		boolean b = isuser(name);
		String url = "";
		MessageVO vo = new MessageVO();
		if (b == true) {
			request.setAttribute("mess", "success");
			vo.setMess("成功");
			vo.setName(name);
			vo.setSsss("sssssssssss");
			vo.setDddd("ddddddddddd");
			url = "/view/MyJsp.jsp";
		} else {
			request.setAttribute("mess", "fail");
			vo.setMess("失败");
			vo.setName(name);
			vo.setSsss("sssssssssss");
			vo.setDddd("ddddddddddd");
			url = "/view/shibai.jsp";
		}
		request.setAttribute("mess", vo);
		return url;
	}
	
	private boolean isuser(String user){
		boolean b = false;
		if ("yxz".equals(user)) {
			b = true;
		}
		return b;
	}

}
